<template>
  <div class="wrapper">
    <button @click="handleClick">修改</button>
    <div>countRef: {{ countRef }}</div>
  </div>
</template>

<script setup lang="ts">
import { reactive, toRef } from 'vue';
let obj = reactive({
  name: '张三',
  count: 0
})

let countRef = toRef(obj, 'count')

const handleClick = () => {
  countRef.value++
  console.log(countRef.value, 'countRef.value');
}

</script>

<style scoped>
div {
  font-size: 28px;
}
</style>